//
//  OuptMainCell.m
//  掌上宏力
//
//  Created by admin on 2017/5/7.
//  Copyright © 2017年 admin. All rights reserved.
//

#import "OuptMainCell.h"

#define Text_W (kScreenW-295)
#define Text_H 30

#define LabFont 14
#define Lab_W 65
#define TextFont 15
#define DesFont 14

@interface OuptMainCell ()

@property (nonatomic,weak) UILabel *visitNoLab;
@property (nonatomic,weak) UILabel *sickDesLab;
@property (nonatomic,weak) UILabel *doctorDesLab;
@property (nonatomic,weak) UILabel *doctorLab;
@property (nonatomic,weak) UILabel *departmentLab;

@end

@implementation OuptMainCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        //编号
        UILabel *visitNoL = [Factory createLabelWithTitle:@"就诊编号:" frame:CGRectMake(10, 5, Lab_W, Text_H) fontSize:LabFont];
        [self.contentView addSubview:visitNoL];
        
        UILabel *visitNoLab = [[UILabel alloc] initWithFrame:CGRectMake(visitNoL.right, 5, Lab_W-15, Text_H)];
        visitNoLab.font = kFont(TextFont);
        [self.contentView addSubview:visitNoLab];
        self.visitNoLab = visitNoLab;
        //医生
        UILabel *doctorL = [Factory createLabelWithTitle:@"医生:" frame:CGRectMake(visitNoLab.right, 5, 35, Text_H) fontSize:LabFont];
        [self.contentView addSubview:doctorL];
        
        UILabel *doctorLab = [[UILabel alloc] initWithFrame:CGRectMake(doctorL.right, 5, Lab_W, Text_H)];
        doctorLab.font = kFont(TextFont);
        [self.contentView addSubview:doctorLab];
        self.doctorLab = doctorLab;
        //科室
        UILabel *departmentL = [Factory createLabelWithTitle:@"科室:" frame:CGRectMake(doctorLab.right, 5, 35, Text_H) fontSize:13];
        [self.contentView addSubview:departmentL];
        
        UILabel *departmentLab = [[UILabel alloc] initWithFrame:CGRectMake(departmentL.right, 5, Lab_W+30, Text_H)];
        departmentLab.font = kFont(14);
        [self.contentView addSubview:departmentLab];
        self.departmentLab = departmentLab;
        //病人描述
        UILabel *sickDesL = [Factory createLabelWithTitle:@"病情描述:" frame:CGRectMake(10, visitNoLab.bottom, Lab_W, Text_H) fontSize:LabFont];
        [self.contentView addSubview:sickDesL];
        
        UILabel *sickDesLab = [[UILabel alloc] initWithFrame:CGRectMake(sickDesL.right, visitNoLab.bottom, kScreenW-105, Text_H)];
        sickDesLab.font = kFont(DesFont);
        sickDesLab.textAlignment = NSTextAlignmentLeft;
        [self.contentView addSubview:sickDesLab];
        self.sickDesLab = sickDesLab;
        //医生诊断
        UILabel *doctorDesL = [Factory createLabelWithTitle:@"诊断结果:" frame:CGRectMake(10, sickDesLab.bottom, Lab_W, Text_H) fontSize:LabFont];
        [self.contentView addSubview:doctorDesL];
        UILabel *doctorDesLab = [[UILabel alloc] initWithFrame:CGRectMake(doctorDesL.right, sickDesLab.bottom, kScreenW-105, 30)];
        doctorDesLab.font = kFont(DesFont);
        doctorDesLab.textAlignment = NSTextAlignmentLeft;
        [self.contentView addSubview:doctorDesLab];
        self.doctorDesLab = doctorDesLab;
        
    }
    return self;
}
-(void)setOuptMain:(OuptMainModel *)ouptMain{
    _ouptMain = ouptMain;
    self.visitNoLab.text = ouptMain.visitNo;
    self.doctorLab.text = ouptMain.doctor;
    self.departmentLab.text = ouptMain.department;
    self.sickDesLab.text = ouptMain.sickDes;
    self.doctorDesLab.text = ouptMain.doctorDes;
}
+(instancetype)cellWithTableView:(UITableView *)tableView{
    static NSString *ID = @"ouptMain";
    OuptMainCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (cell == nil) {
        cell = [[OuptMainCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];
    }
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    return cell;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
